<?php $this->load->view("layout/slide");?>

<div class="infobox-container" style="width: 50%; float: left;">
    <div class="triangle-l"></div>
    <div class="triangle-r"></div>
    <div class="infobox">
        <h3><span>Đặt lịch khám</span></h3>
        <img src="<?php echo base_url()?>public/images/datlich2.jpg" style="width: 100%;" />
    </div>
</div>

<div class="infobox-container" style="width: 50%; float: left;">
    <div class="triangle-l"></div>
    <div class="triangle-r"></div>
    <div class="infobox">
        <h3><span>Đặt lịch xét nghiệm</span></h3>
        <img src="<?php echo base_url()?>public/images/datlich2.jpg" style="width: 100%;" />
    </div>
</div>

<?php foreach($newentries as $key=>$value) { ?>

<div class="panel panel-primary">
    <div class="panel-heading">
        <h3 class="panel-title"><?php echo $key;?></h3>
    </div>
    <div class="panel-body">
        <?php 
            $count = 0;
            $total = count($value); 
            foreach($value as $k=>$v) { ?>
        
        <?php if($count%2 && $count < 3) {?>
            <div>
        <?php }?>
        
        <?php if($count < 3) {?>
            <div style="width: 49%; <?php if($count%2) echo 'float: right;'; else echo 'float: left;'?>">
                <span class="title"><a href="<?php echo base_url(), $slugcategories[$v['categoryid']], '/', $v['slug'];?>"><?php echo $v['title']?></a></span><br />
                <a href="<?php echo base_url(), $slugcategories[$v['categoryid']], '/', $v['slug'];?>"><img src="<?php echo $v['image']?>" class="thumbnail" width="100" style="float: left; margin-right: 10px;"/></a>
                <?php echo character_limiter($v['description'], 250)?>
                <div class="clearfix"></div>
            </div>
        <?php } else {?>
            <?php if($count==3) {?>
                <div style="width: 49%; <?php if($count%2) echo 'float: right;'; else echo 'float: left;'?>">
            <?php }?>
            <a href="<?php echo base_url(), $slugcategories[$v['categoryid']], '/', $v['slug'];?>" class="bullets"><?php echo character_limiter($v['title'], 75)?></a><br />
            <?php if($count==$total-1) {?>
                </div>
            <?php }?>
        <?php }?>
        
        <?php if($count%2 && $count < 3) {?>
            <div class="clearfix"></div>
            </div>
        <?php }?>
                
        <?php $count = $count + 1; } ?>
    </div>
</div>

<?php } ?>